package com.com.knowledgepaymentmanagementsystem.service.marketing.impl;

import com.com.knowledgepaymentmanagementsystem.mapper.marketing.SceneMapper;
import com.com.knowledgepaymentmanagementsystem.pojo.marketing.Scene;
import com.com.knowledgepaymentmanagementsystem.service.marketing.SceneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 张攀
 * @version 1.0
 * @description: TODO
 * @date 2025/9/23 下午4:05
 */
@Service
public class SceneServiceImpl implements SceneService {
    @Autowired
    private SceneMapper sceneMapper;

    @Override
    public List<Scene> findScene(Scene scene) {
        return sceneMapper.findScene(scene);
    }

    @Override
    public Object insertScene(Scene scene) {
        scene.setCreateTime(LocalDateTime.now());
        scene.setSceneTime(LocalDateTime.now());
        return sceneMapper.insert(scene);
    }

    @Override
    public void updateScene(Scene scene) {
        sceneMapper.updateById(scene);
    }

    @Override
    public void deleteeScene(Integer id) {
        sceneMapper.deleteById(id);
    }
}
